#include <iostream>
#include <memory>
#include <string>
#include <list>

using namespace std;

/*
\ brief:  雇员类
\ author: 清晨与猫鱼
*/
class Employee {
public:
    explicit Employee(string name, string dept, int sal) 
        : name_(move(name)), dept_(move(dept)), salary_(sal) {
    }

/*
\ brief:   添加雇员
\ author: 清晨与猫鱼
*/
    void add(Employee* e) {
        subordinates_.emplace_back(e);
    }

/*
\ brief:  移除雇员
\ author: 清晨与猫鱼
*/
    void remove(Employee* e) {
       subordinates_.remove_if([&](unique_ptr<Employee>& el) {
           return e == el.get();
       });
    }

/*
\ brief:  获取员工列表
\ author: 清晨与猫鱼
*/
    list<unique_ptr<Employee>>& getSubordinates() {
        return subordinates_;
    }

/*
\ brief:  打印雇员信息
\ author: 清晨与猫鱼
*/
    string toString() {
        return "Employee :[ Name : " + name_ + ", dept : " + dept_ + ", salary :" + to_string(salary_) + " ]";
    }
private:
    string name_;
    string dept_;
    int salary_;
    list<unique_ptr<Employee>> subordinates_;       // 雇员容器
};


